home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1351 < prev    next >
Encoding:
Text File  |  1996-08-05  |  928 b   |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!simg
  3. From: simg@netcom.com (SimGraphics)
  4. Subject: Re: Watcom C/C++ Gurus:  Please Help.
  5. Message-ID: <simgDL3LtF.HH5@netcom.com>
  6. Reply-To: sylvek@simg.com
  7. Organization: SimGraphics Engineering, South Pasadena, California
  8. References: <4d4mvi$a13@victoria.pe.net>
  9. Date: Sat, 13 Jan 1996 02:34:27 GMT
  10. Sender: simg@netcom7.netcom.com
  11.  
  12. Here is the simple solution for your problem:
  13.  
  14. 1) using the documentation and debugger find the layout of the stack
  15.    frame of your interrupt procedure.
  16.  
  17. 2) You can take the address of the local integer variable on stack with the
  18.    & operator and assign it to an int * variable
  19.  
  20. 3) Knowing the layout of stack frame you can find the offset (in words)
  21.    between saved segment register and your int variable.
  22.  
  23. 4) Add this offset to your int * variable
  24.  
  25. 5) Use this pointer to patch the saved register on the stack frame
  26.  
  27. That is it.
  28.  
  29. Good luck,
  30.  
  31. Sylvester
  32.